\(\int \cos ^3(e+f x) \sqrt {a+b \sec ^2(e+f x)} \, dx\) [232]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [C] (warning: unable to verify)
   Fricas [F]
   Sympy [F(-1)]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 25, antiderivative size = 246 \[ \int \cos ^3(e+f x) \sqrt {a+b \sec ^2(e+f x)} \, dx=\frac {\cos ^2(e+f x) \sin (e+f x) \sqrt {\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )}}{3 f}+\frac {(2 a+b) \sqrt {\cos ^2(e+f x)} E\left (\arcsin (\sin (e+f x))\left |\frac {a}{a+b}\right .\right ) \sqrt {\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )}}{3 a f \sqrt {1-\frac {a \sin ^2(e+f x)}{a+b}}}-\frac {b (a+b) \sqrt {\cos ^2(e+f x)} \operatorname {EllipticF}\left (\arcsin (\sin (e+f x)),\frac {a}{a+b}\right ) \sqrt {\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )} \sqrt {1-\frac {a \sin ^2(e+f x)}{a+b}}}{3 a f \left (a+b-a \sin ^2(e+f x)\right )} \]

[Out]

1/3*cos(f*x+e)^2*sin(f*x+e)*(sec(f*x+e)^2*(a+b-a*sin(f*x+e)^2))^(1/2)/f+1/3*(2*a+b)*EllipticE(sin(f*x+e),(a/(a
+b))^(1/2))*(cos(f*x+e)^2)^(1/2)*(sec(f*x+e)^2*(a+b-a*sin(f*x+e)^2))^(1/2)/a/f/(1-a*sin(f*x+e)^2/(a+b))^(1/2)-
1/3*b*(a+b)*EllipticF(sin(f*x+e),(a/(a+b))^(1/2))*(cos(f*x+e)^2)^(1/2)*(sec(f*x+e)^2*(a+b-a*sin(f*x+e)^2))^(1/
2)*(1-a*sin(f*x+e)^2/(a+b))^(1/2)/a/f/(a+b-a*sin(f*x+e)^2)

Rubi [A] (verified)

Time = 0.37 (sec) , antiderivative size = 246, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.360, Rules used = {4233, 1985, 1986, 428, 538, 437, 435, 432, 430} \[ \int \cos ^3(e+f x) \sqrt {a+b \sec ^2(e+f x)} \, dx=-\frac {b (a+b) \sqrt {\cos ^2(e+f x)} \sqrt {1-\frac {a \sin ^2(e+f x)}{a+b}} \sqrt {\sec ^2(e+f x) \left (-a \sin ^2(e+f x)+a+b\right )} \operatorname {EllipticF}\left (\arcsin (\sin (e+f x)),\frac {a}{a+b}\right )}{3 a f \left (-a \sin ^2(e+f x)+a+b\right )}+\frac {(2 a+b) \sqrt {\cos ^2(e+f x)} \sqrt {\sec ^2(e+f x) \left (-a \sin ^2(e+f x)+a+b\right )} E\left (\arcsin (\sin (e+f x))\left |\frac {a}{a+b}\right .\right )}{3 a f \sqrt {1-\frac {a \sin ^2(e+f x)}{a+b}}}+\frac {\sin (e+f x) \cos ^2(e+f x) \sqrt {\sec ^2(e+f x) \left (-a \sin ^2(e+f x)+a+b\right )}}{3 f} \]

[In]

Int[Cos[e + f*x]^3*Sqrt[a + b*Sec[e + f*x]^2],x]

[Out]

(Cos[e + f*x]^2*Sin[e + f*x]*Sqrt[Sec[e + f*x]^2*(a + b - a*Sin[e + f*x]^2)])/(3*f) + ((2*a + b)*Sqrt[Cos[e +
f*x]^2]*EllipticE[ArcSin[Sin[e + f*x]], a/(a + b)]*Sqrt[Sec[e + f*x]^2*(a + b - a*Sin[e + f*x]^2)])/(3*a*f*Sqr
t[1 - (a*Sin[e + f*x]^2)/(a + b)]) - (b*(a + b)*Sqrt[Cos[e + f*x]^2]*EllipticF[ArcSin[Sin[e + f*x]], a/(a + b)
]*Sqrt[Sec[e + f*x]^2*(a + b - a*Sin[e + f*x]^2)]*Sqrt[1 - (a*Sin[e + f*x]^2)/(a + b)])/(3*a*f*(a + b - a*Sin[
e + f*x]^2))

Rule 428

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[x*(a + b*x^n)^p*((c + d*x^n
)^q/(n*(p + q) + 1)), x] + Dist[n/(n*(p + q) + 1), Int[(a + b*x^n)^(p - 1)*(c + d*x^n)^(q - 1)*Simp[a*c*(p + q
) + (q*(b*c - a*d) + a*d*(p + q))*x^n, x], x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && GtQ[q,
0] && GtQ[p, 0] && IntBinomialQ[a, b, c, d, n, p, q, x]

Rule 430

Int[1/(Sqrt[(a_) + (b_.)*(x_)^2]*Sqrt[(c_) + (d_.)*(x_)^2]), x_Symbol] :> Simp[(1/(Sqrt[a]*Sqrt[c]*Rt[-d/c, 2]
))*EllipticF[ArcSin[Rt[-d/c, 2]*x], b*(c/(a*d))], x] /; FreeQ[{a, b, c, d}, x] && NegQ[d/c] && GtQ[c, 0] && Gt
Q[a, 0] &&  !(NegQ[b/a] && SimplerSqrtQ[-b/a, -d/c])

Rule 432

Int[1/(Sqrt[(a_) + (b_.)*(x_)^2]*Sqrt[(c_) + (d_.)*(x_)^2]), x_Symbol] :> Dist[Sqrt[1 + (d/c)*x^2]/Sqrt[c + d*
x^2], Int[1/(Sqrt[a + b*x^2]*Sqrt[1 + (d/c)*x^2]), x], x] /; FreeQ[{a, b, c, d}, x] &&  !GtQ[c, 0]

Rule 435

Int[Sqrt[(a_) + (b_.)*(x_)^2]/Sqrt[(c_) + (d_.)*(x_)^2], x_Symbol] :> Simp[(Sqrt[a]/(Sqrt[c]*Rt[-d/c, 2]))*Ell
ipticE[ArcSin[Rt[-d/c, 2]*x], b*(c/(a*d))], x] /; FreeQ[{a, b, c, d}, x] && NegQ[d/c] && GtQ[c, 0] && GtQ[a, 0
]

Rule 437

Int[Sqrt[(a_) + (b_.)*(x_)^2]/Sqrt[(c_) + (d_.)*(x_)^2], x_Symbol] :> Dist[Sqrt[a + b*x^2]/Sqrt[1 + (b/a)*x^2]
, Int[Sqrt[1 + (b/a)*x^2]/Sqrt[c + d*x^2], x], x] /; FreeQ[{a, b, c, d}, x] && NegQ[d/c] && GtQ[c, 0] &&  !GtQ
[a, 0]

Rule 538

Int[((e_) + (f_.)*(x_)^(n_))/(Sqrt[(a_) + (b_.)*(x_)^(n_)]*Sqrt[(c_) + (d_.)*(x_)^(n_)]), x_Symbol] :> Dist[f/
b, Int[Sqrt[a + b*x^n]/Sqrt[c + d*x^n], x], x] + Dist[(b*e - a*f)/b, Int[1/(Sqrt[a + b*x^n]*Sqrt[c + d*x^n]),
x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] &&  !(EqQ[n, 2] && ((PosQ[b/a] && PosQ[d/c]) || (NegQ[b/a] && (PosQ[
d/c] || (GtQ[a, 0] && ( !GtQ[c, 0] || SimplerSqrtQ[-b/a, -d/c]))))))

Rule 1985

Int[(u_.)*((a_) + (b_.)/((c_) + (d_.)*(x_)^(n_)))^(p_), x_Symbol] :> Int[u*((b + a*c + a*d*x^n)/(c + d*x^n))^p
, x] /; FreeQ[{a, b, c, d, n, p}, x]

Rule 1986

Int[(u_.)*((e_.)*((a_.) + (b_.)*(x_)^(n_.))^(q_.)*((c_) + (d_.)*(x_)^(n_))^(r_.))^(p_), x_Symbol] :> Dist[Simp
[(e*(a + b*x^n)^q*(c + d*x^n)^r)^p/((a + b*x^n)^(p*q)*(c + d*x^n)^(p*r))], Int[u*(a + b*x^n)^(p*q)*(c + d*x^n)
^(p*r), x], x] /; FreeQ[{a, b, c, d, e, n, p, q, r}, x]

Rule 4233

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = Fr
eeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[(a + b/(1 - ff^2*x^2)^(n/2))^p/(1 - ff^2*x^2)^((m + 1)/2), x
], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n/2] &&  !IntegerQ
[p]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \left (1-x^2\right ) \sqrt {a+\frac {b}{1-x^2}} \, dx,x,\sin (e+f x)\right )}{f} \\ & = \frac {\text {Subst}\left (\int \left (1-x^2\right ) \sqrt {\frac {a+b-a x^2}{1-x^2}} \, dx,x,\sin (e+f x)\right )}{f} \\ & = \frac {\left (\sqrt {\cos ^2(e+f x)} \sqrt {\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )}\right ) \text {Subst}\left (\int \sqrt {1-x^2} \sqrt {a+b-a x^2} \, dx,x,\sin (e+f x)\right )}{f \sqrt {a+b-a \sin ^2(e+f x)}} \\ & = \frac {\cos ^2(e+f x) \sin (e+f x) \sqrt {\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )}}{3 f}+\frac {\left (2 \sqrt {\cos ^2(e+f x)} \sqrt {\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )}\right ) \text {Subst}\left (\int \frac {a+b+\frac {1}{2} (-2 a-b) x^2}{\sqrt {1-x^2} \sqrt {a+b-a x^2}} \, dx,x,\sin (e+f x)\right )}{3 f \sqrt {a+b-a \sin ^2(e+f x)}} \\ & = \frac {\cos ^2(e+f x) \sin (e+f x) \sqrt {\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )}}{3 f}-\frac {\left ((-2 a-b) \sqrt {\cos ^2(e+f x)} \sqrt {\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )}\right ) \text {Subst}\left (\int \frac {\sqrt {a+b-a x^2}}{\sqrt {1-x^2}} \, dx,x,\sin (e+f x)\right )}{3 a f \sqrt {a+b-a \sin ^2(e+f x)}}-\frac {\left (b (a+b) \sqrt {\cos ^2(e+f x)} \sqrt {\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1-x^2} \sqrt {a+b-a x^2}} \, dx,x,\sin (e+f x)\right )}{3 a f \sqrt {a+b-a \sin ^2(e+f x)}} \\ & = \frac {\cos ^2(e+f x) \sin (e+f x) \sqrt {\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )}}{3 f}-\frac {\left ((-2 a-b) \sqrt {\cos ^2(e+f x)} \sqrt {\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )}\right ) \text {Subst}\left (\int \frac {\sqrt {1-\frac {a x^2}{a+b}}}{\sqrt {1-x^2}} \, dx,x,\sin (e+f x)\right )}{3 a f \sqrt {1-\frac {a \sin ^2(e+f x)}{a+b}}}-\frac {\left (b (a+b) \sqrt {\cos ^2(e+f x)} \sqrt {\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )} \sqrt {1-\frac {a \sin ^2(e+f x)}{a+b}}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1-x^2} \sqrt {1-\frac {a x^2}{a+b}}} \, dx,x,\sin (e+f x)\right )}{3 a f \left (a+b-a \sin ^2(e+f x)\right )} \\ & = \frac {\cos ^2(e+f x) \sin (e+f x) \sqrt {\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )}}{3 f}+\frac {(2 a+b) \sqrt {\cos ^2(e+f x)} E\left (\arcsin (\sin (e+f x))\left |\frac {a}{a+b}\right .\right ) \sqrt {\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )}}{3 a f \sqrt {1-\frac {a \sin ^2(e+f x)}{a+b}}}-\frac {b (a+b) \sqrt {\cos ^2(e+f x)} \operatorname {EllipticF}\left (\arcsin (\sin (e+f x)),\frac {a}{a+b}\right ) \sqrt {\sec ^2(e+f x) \left (a+b-a \sin ^2(e+f x)\right )} \sqrt {1-\frac {a \sin ^2(e+f x)}{a+b}}}{3 a f \left (a+b-a \sin ^2(e+f x)\right )} \\ \end{align*}

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 13.40 (sec) , antiderivative size = 402, normalized size of antiderivative = 1.63 \[ \int \cos ^3(e+f x) \sqrt {a+b \sec ^2(e+f x)} \, dx=\frac {\cos (e+f x) \sqrt {a+b \sec ^2(e+f x)} \left (\frac {6 \sqrt {2} \sqrt {a+2 b+a \cos (2 (e+f x))} E\left (e+f x\left |\frac {a}{a+b}\right .\right )}{\sqrt {\frac {a+2 b+a \cos (2 (e+f x))}{a+b}}}+\frac {\sqrt {-\frac {1}{b}} b \csc ^2(2 (e+f x)) \sec (2 (e+f x)) \left (4 i \sqrt {2} \left (a^2+3 a b+2 b^2\right ) \sqrt {-\frac {a \cos ^2(e+f x)}{b}} E\left (i \text {arcsinh}\left (\frac {\sqrt {-\frac {1}{b}} \sqrt {a+2 b+a \cos (2 (e+f x))}}{\sqrt {2}}\right )|\frac {b}{a+b}\right ) \sqrt {\frac {a \sin ^2(e+f x)}{a+b}}+a \left (a \sqrt {-\frac {1}{b}} \sqrt {a+2 b+a \cos (2 (e+f x))} (-1+\cos (4 (e+f x)))-4 i \sqrt {2} (a+b) \sqrt {-\frac {a \cos ^2(e+f x)}{b}} \operatorname {EllipticF}\left (i \text {arcsinh}\left (\frac {\sqrt {-\frac {1}{b}} \sqrt {a+2 b+a \cos (2 (e+f x))}}{\sqrt {2}}\right ),\frac {b}{a+b}\right ) \sqrt {\frac {a \sin ^2(e+f x)}{a+b}}\right )\right ) \sin (4 (e+f x))}{2 a^2}\right )}{12 f \sqrt {a+2 b+a \cos (2 (e+f x))}} \]

[In]

Integrate[Cos[e + f*x]^3*Sqrt[a + b*Sec[e + f*x]^2],x]

[Out]

(Cos[e + f*x]*Sqrt[a + b*Sec[e + f*x]^2]*((6*Sqrt[2]*Sqrt[a + 2*b + a*Cos[2*(e + f*x)]]*EllipticE[e + f*x, a/(
a + b)])/Sqrt[(a + 2*b + a*Cos[2*(e + f*x)])/(a + b)] + (Sqrt[-b^(-1)]*b*Csc[2*(e + f*x)]^2*Sec[2*(e + f*x)]*(
(4*I)*Sqrt[2]*(a^2 + 3*a*b + 2*b^2)*Sqrt[-((a*Cos[e + f*x]^2)/b)]*EllipticE[I*ArcSinh[(Sqrt[-b^(-1)]*Sqrt[a +
2*b + a*Cos[2*(e + f*x)]])/Sqrt[2]], b/(a + b)]*Sqrt[(a*Sin[e + f*x]^2)/(a + b)] + a*(a*Sqrt[-b^(-1)]*Sqrt[a +
 2*b + a*Cos[2*(e + f*x)]]*(-1 + Cos[4*(e + f*x)]) - (4*I)*Sqrt[2]*(a + b)*Sqrt[-((a*Cos[e + f*x]^2)/b)]*Ellip
ticF[I*ArcSinh[(Sqrt[-b^(-1)]*Sqrt[a + 2*b + a*Cos[2*(e + f*x)]])/Sqrt[2]], b/(a + b)]*Sqrt[(a*Sin[e + f*x]^2)
/(a + b)]))*Sin[4*(e + f*x)])/(2*a^2)))/(12*f*Sqrt[a + 2*b + a*Cos[2*(e + f*x)]])

Maple [C] (warning: unable to verify)

Result contains complex when optimal does not.

Time = 7.23 (sec) , antiderivative size = 6300, normalized size of antiderivative = 25.61

method result size
default \(\text {Expression too large to display}\) \(6300\)

[In]

int(cos(f*x+e)^3*(a+b*sec(f*x+e)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

result too large to display

Fricas [F]

\[ \int \cos ^3(e+f x) \sqrt {a+b \sec ^2(e+f x)} \, dx=\int { \sqrt {b \sec \left (f x + e\right )^{2} + a} \cos \left (f x + e\right )^{3} \,d x } \]

[In]

integrate(cos(f*x+e)^3*(a+b*sec(f*x+e)^2)^(1/2),x, algorithm="fricas")

[Out]

integral(sqrt(b*sec(f*x + e)^2 + a)*cos(f*x + e)^3, x)

Sympy [F(-1)]

Timed out. \[ \int \cos ^3(e+f x) \sqrt {a+b \sec ^2(e+f x)} \, dx=\text {Timed out} \]

[In]

integrate(cos(f*x+e)**3*(a+b*sec(f*x+e)**2)**(1/2),x)

[Out]

Timed out

Maxima [F]

\[ \int \cos ^3(e+f x) \sqrt {a+b \sec ^2(e+f x)} \, dx=\int { \sqrt {b \sec \left (f x + e\right )^{2} + a} \cos \left (f x + e\right )^{3} \,d x } \]

[In]

integrate(cos(f*x+e)^3*(a+b*sec(f*x+e)^2)^(1/2),x, algorithm="maxima")

[Out]

integrate(sqrt(b*sec(f*x + e)^2 + a)*cos(f*x + e)^3, x)

Giac [F]

\[ \int \cos ^3(e+f x) \sqrt {a+b \sec ^2(e+f x)} \, dx=\int { \sqrt {b \sec \left (f x + e\right )^{2} + a} \cos \left (f x + e\right )^{3} \,d x } \]

[In]

integrate(cos(f*x+e)^3*(a+b*sec(f*x+e)^2)^(1/2),x, algorithm="giac")

[Out]

integrate(sqrt(b*sec(f*x + e)^2 + a)*cos(f*x + e)^3, x)

Mupad [F(-1)]

Timed out. \[ \int \cos ^3(e+f x) \sqrt {a+b \sec ^2(e+f x)} \, dx=\int {\cos \left (e+f\,x\right )}^3\,\sqrt {a+\frac {b}{{\cos \left (e+f\,x\right )}^2}} \,d x \]

[In]

int(cos(e + f*x)^3*(a + b/cos(e + f*x)^2)^(1/2),x)

[Out]

int(cos(e + f*x)^3*(a + b/cos(e + f*x)^2)^(1/2), x)